package yunwo.cn.yzstation.view.activity;

import android.content.Intent;
import android.graphics.BitmapFactory;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import com.zhy.autolayout.AutoLayoutActivity;

import java.util.ArrayList;
import java.util.List;

import yunwo.cn.yzstation.R;
import yunwo.cn.yzstation.adapter.TakegoodsAdapter;
import yunwo.cn.yzstation.base.MyBaseActivity;
import yunwo.cn.yzstation.view.fregment.takegoods.CompleteFregment;
import yunwo.cn.yzstation.view.fregment.takegoods.TakeingFregment;
import yunwo.cn.yzstation.view.fregment.takegoods.WaitTakeFregment;

public class TakegoodsActivity extends MyBaseActivity implements View.OnClickListener{



    private TextView mScan;
    private TabLayout mTakegoods_tab;
    private ViewPager mTakegoods_vp;
    private ImageView mImg;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        initView();
        initEvent();
    }

    @Override
    protected String settiltile() {
        return "提货任务";
    }

    @Override
    protected int getLayoutRsid() {
        return R.layout.activity_takegoods;
    }

    private void initEvent() {
        List<Fragment> list = new ArrayList<>();
        list.add(new WaitTakeFregment());
        list.add(new TakeingFregment());
        list.add(new CompleteFregment());
        TakegoodsAdapter takegoodsAdapter = new TakegoodsAdapter(getSupportFragmentManager(),list);
        mTakegoods_vp.setAdapter(takegoodsAdapter);
        mTakegoods_tab.setupWithViewPager(mTakegoods_vp);

    }

    private void initView() {


        mImg = (ImageView) findViewById(R.id.img);
        mImg.setImageResource(R.drawable.nav_btn_search);
        mImg.setOnClickListener(this);

        mTakegoods_vp = (ViewPager) findViewById(R.id.takegoods_vp);
        mTakegoods_tab = (TabLayout) findViewById(R.id.takegoods_tab);

    }


    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.img:
                Intent intent = new Intent(TakegoodsActivity.this, SeaechActivity.class);
                startActivity(intent);

                break;
        }
    }
}
